#ifndef __CORE_VECTOR4__
#define __CORE_VECTOR4__
#include "Vector3.h"
namespace Core
{
	class rtVector2;
	class rtVector3;
	class rtVector4
	{
	public:
		float			x;
		float			y;
		float			z;
		float			w;

		rtVector4(void);
		explicit rtVector4(const float x, const float y, const float z, const float w);
		static rtVector4 vec4_origin;
		void 			set(const float x, const float y, const float z, const float w);
		void			zero(void);

		float			operator [] (const int index) const;
		float&			operator [] (const int index);
		rtVector4		operator - () const;
		float			operator * (const rtVector4& a) const;
		rtVector4		operator * (const float a) const;
		rtVector4		operator / (const float a) const;
		rtVector4		operator + (const rtVector4& a) const;
		rtVector4		operator - (const rtVector4& a) const;
		rtVector4&		operator += (const rtVector4& a);
		rtVector4&		operator -= (const rtVector4& a);
		rtVector4&		operator /= (const rtVector4& a);
		rtVector4&		operator /= (const float a);
		rtVector4&		operator *= (const float a);

		friend rtVector4	operator*(const float a, const rtVector4 b);

		bool			compare(const rtVector4& a) const;
		bool			compare(const rtVector4& a, const float epsilon) const;
		bool			operator==(const rtVector4& a) const;
		bool			operator!=(const rtVector4& a) const;

		float			length(void) const;
		float			lengthSqr(void) const;
		float			normalize(void);
		float			normalizeFast(void);

		int				getDimension(void) const;

		const rtVector2& toVec2(void) const;
		rtVector2&		toVec2(void);
		const rtVector3& toVec3(void) const;
		rtVector3&		toVec3(void);
		const float*	toFloatPtr(void) const;
		float*			toFloatPtr(void);

		void			lerp(const rtVector4& v1, const rtVector4& v2, const float l);
	};
}
#endif


